<?php

class Emms_Form_Admin_BankTool extends HTech_Form
{
    var $_primary  = 'BankId';
    
    public function __construct() 
    {
        parent::__construct();        
        
        $this->setName('BankTool');
                
        $bankId = new Zend_Form_Element_Hidden('BankId');
                
        $groupId = new Zend_Form_Element_Select('Group');
        $groupId->setLabel("Groups")                
            ->setAttrib('size','5')
            ->addMultiOptions(Groups::getGroupOptions('Bank', Zend_Controller_Front::getInstance()->getRequest()->getParam('id')));   
                
        $clientId = new Zend_Form_Element_Select('Client');
        $clientId->setLabel("Clients - click group above to view the corresponding clients")               
            ->setAttrib('size','5')
            ->addMultiOptions(Clients::getClientOptions('Group', Zend_Controller_Front::getInstance()->getRequest()->getParam('group'))); 
        
        $addGroup = new Zend_Form_Element_Button('AddGroup');
        $addGroup->setLabel("Add new")
            ->setAttrib('disabled','disabled')
            ->removeDecorator('DtDdWrapper');
        
        $importGroup = new Zend_Form_Element_Button('ImportGroup');
        $importGroup->setLabel("Import")
            ->removeDecorator('DtDdWrapper');  
        
        $exportGroup = new Zend_Form_Element_Button('ExportGroup');
        $exportGroup->setLabel("Export")
            ->setAttrib('disabled','disabled')
            ->removeDecorator('DtDdWrapper');
        
        $viewGroup = new Zend_Form_Element_Button('ViewGroup');
        $viewGroup->setLabel("View")
            ->setAttrib('disabled','disabled')
            ->removeDecorator('DtDdWrapper');
        
        $deleteGroup = new Zend_Form_Element_Button('DeleteGroup');
        $deleteGroup->setLabel("Delete")
            ->setAttrib('disabled','disabled')
            ->removeDecorator('DtDdWrapper');
        
        $viewClient = new Zend_Form_Element_Button('ViewClient');
        $viewClient->setLabel("View")
            ->setAttrib('disabled','disabled')
            ->removeDecorator('DtDdWrapper');
        
        $addClient = new Zend_Form_Element_Button('AddClient');
        $addClient->setLabel("Add new")
            ->setAttrib('disabled','disabled')
            ->removeDecorator('DtDdWrapper');
        
        $importClient = new Zend_Form_Element_Button('ImportClient');
        $importClient->setLabel("Import")
            ->removeDecorator('DtDdWrapper');  
        
        $editClient = new Zend_Form_Element_Button('EditClient');
        $editClient->setLabel("Edit or export")
            ->setAttrib('disabled','disabled')
            ->removeDecorator('DtDdWrapper');
        
        $deactivateClient = new Zend_Form_Element_Button('DeactivateClient');
        $deactivateClient->setLabel("Deactivate")
            ->setAttrib('disabled','disabled')
            ->removeDecorator('DtDdWrapper');
                
        $submit = new Zend_Form_Element_Submit('Submit');
        $submit->setLabel("Submit")
            ->addDecorator(new HTech_Form_Decorator_Button(array('type'=>'submit')));
        
        $this->setDecorators(array(array('ViewScript', array('viewScript' => 'bank/_form_tool.phtml'))));
        $this->addElements(array($groupId, $clientId, $addGroup, $importGroup, $exportGroup, $viewGroup, $deleteGroup,
            $viewClient, $addClient, $importClient, $editClient, $deactivateClient, $bankId));
    }
}